package com.xncoding.aop.config.Conditionl;

import com.xncoding.aop.annotation.Conditional.ConditionalOnSkill;
import com.xncoding.aop.service.Conditional.BrotherRoosterRap;
import com.xncoding.aop.service.Conditional.BrotherRoosterSkill;
import com.xncoding.aop.service.Conditional.BrotherRoosterSkillBasketball;
import com.xncoding.aop.service.Conditional.BrotherRoosterSkillSing;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class ConditionConfig {

    @Bean("brotherRoosterSkill")
    @ConditionalOnSkill("basketball")
    BrotherRoosterSkill brotherRoosterSkillBasketball(){
        System.out.println("打篮球技能激活。。。。。");
        return new BrotherRoosterSkillBasketball();
    }

    @Bean("brotherRoosterSkill")
    @ConditionalOnSkill("rap")
    BrotherRoosterSkill brotherRoosterSkillRap(){
        System.out.println("Rap技能激活。。。。。");
        return new BrotherRoosterRap();
    }

    @Bean("brotherRoosterSkill")
    @ConditionalOnSkill("sing")
    BrotherRoosterSkill brotherRoosterSkillSing(){
        System.out.println("唱跳技能激活。。。。。");
        return new BrotherRoosterSkillSing();
    }
}

